package com.jswdwsx.esign.entity

import com.jswdwsx.esign.cloud.enums.SealTypeEnum
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.hibernate.annotations.GenericGenerator
import org.hibernate.annotations.Parameter
import org.springframework.data.jpa.domain.support.AuditingEntityListener
import javax.persistence.*

@Entity
@EntityListeners(AuditingEntityListener::class)
@DynamicInsert
@DynamicUpdate
@Table(name = "seal")
class SealPO(

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @GenericGenerator(name = "jpa-uuid", strategy = "uuid")
    var id: String? = null,

    @Column(name = "esign_seal_id")
    var esignSealId: String,            // e签宝seal_id

    @Column(name = "file_key")
    var fileKey: String? = null,                // varchar(16) DEFAULT NULL COMMENT '1处理中；2已完成: 所有签署人完成签署； 3已撤销: 发起方撤销签署任务； 4已终止: 至少一个签署人拒签或通过重试不可恢复的签署失败 ； 5已过期: 超时未签署 ；6: 已删除；7：已拒签'

    @Column(name = "name")
    var name: String? = null,

    @Column(name = "owner")
    var owner: String,

    @Column(name = "type")
    @Enumerated(EnumType.STRING)
    var type: SealTypeEnum

)